//
//  ExercisesPageTitleModel.m
//  ShowYork
//
//  Created by hxh on 2020/9/8.
//  Copyright © 2020 hxh. All rights reserved.
//

#import "ExercisesTitleModel.h"

@implementation ExercisesTitleModel
MJCodingImplementation
+(NSDictionary *)mj_objectClassInArray{
    return @{@"questionItems":[ExercisesQuqestionModel class]};
}
- (NSString *)totalScore{
    int score = 0;
    for (ExercisesQuqestionModel *obj in _questionItems) {
        score+=obj.score.intValue;
    }
    return [NSString stringWithFormat:@"%i",score];
}

- (NSString *)realScore{
    int score = 0;
    for (ExercisesQuqestionModel *obj in _questionItems) {
        score += obj.answerItem.score.intValue;
    }
    return [NSString stringWithFormat:@"%i",score];
}
- (NSString *)replyScore{
    int score = 0;
    for (ExercisesQuqestionModel *obj in _questionItems) {
        if (obj.questionType.intValue == 1) {
            score += obj.score.intValue;
        }
    }
    return [NSString stringWithFormat:@"%i",score];
}
@end
